package com.ruoyi.lucky.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lucky.mapper.TBoxsellInfoMapper;
import com.ruoyi.lucky.domain.TBoxsellInfo;
import com.ruoyi.lucky.service.ITBoxsellInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 盲盒出售Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-12
 */
@Service
public class TBoxsellInfoServiceImpl implements ITBoxsellInfoService 
{
    @Autowired
    private TBoxsellInfoMapper tBoxsellInfoMapper;

    /**
     * 查询盲盒出售
     * 
     * @param boxsellId 盲盒出售ID
     * @return 盲盒出售
     */
    @Override
    public TBoxsellInfo selectTBoxsellInfoById(Long boxsellId)
    {
        return tBoxsellInfoMapper.selectTBoxsellInfoById(boxsellId);
    }

    /**
     * 查询盲盒出售列表
     * 
     * @param tBoxsellInfo 盲盒出售
     * @return 盲盒出售
     */
    @Override
    public List<TBoxsellInfo> selectTBoxsellInfoList(TBoxsellInfo tBoxsellInfo)
    {
        return tBoxsellInfoMapper.selectTBoxsellInfoList(tBoxsellInfo);
    }

    /**
     * 新增盲盒出售
     * 
     * @param tBoxsellInfo 盲盒出售
     * @return 结果
     */
    @Override
    public int insertTBoxsellInfo(TBoxsellInfo tBoxsellInfo)
    {
        tBoxsellInfo.setCreateTime(DateUtils.getNowDate());
        return tBoxsellInfoMapper.insertTBoxsellInfo(tBoxsellInfo);
    }

    /**
     * 修改盲盒出售
     * 
     * @param tBoxsellInfo 盲盒出售
     * @return 结果
     */
    @Override
    public int updateTBoxsellInfo(TBoxsellInfo tBoxsellInfo)
    {
        tBoxsellInfo.setUpdateTime(DateUtils.getNowDate());
        return tBoxsellInfoMapper.updateTBoxsellInfo(tBoxsellInfo);
    }

    /**
     * 删除盲盒出售对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTBoxsellInfoByIds(String ids)
    {
        return tBoxsellInfoMapper.deleteTBoxsellInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除盲盒出售信息
     * 
     * @param boxsellId 盲盒出售ID
     * @return 结果
     */
    @Override
    public int deleteTBoxsellInfoById(Long boxsellId)
    {
        return tBoxsellInfoMapper.deleteTBoxsellInfoById(boxsellId);
    }
}
